<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //64位双精度浮点数
        //浮点数，十进制向二进制转换的时候存在精度丢失
        console.log(0.1 + 0.2);
        console.log(19.99 + 20.00);
        console.log((19.99 + 20.00).toFixed(2));
        //整数不存在精度丢失的问题
        console.log((19.99 * 100 + 20.00 * 100) / 100);
    </script>
</body>

</html>